#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# 让一个类的对象具备另一个类对象的属性


class Course(object):
    def __init__(self, name, period, price):
        self.name = name
        self.period = period
        self.price = price

    def chiose_course(self):
        print("课程名{}\n周期:{}\n价格:{}\n".format(self.name, self.period, self.price))


class BaseInfo(object):
    def __init__(self, name, age, sex):
        self.name = name
        self.age = age
        self.sex = sex


class Student(BaseInfo):
    def __init__(self, name, age, sex, classes):
        BaseInfo.__init__(self, name, age, sex)
        self.classes = classes


stu1 = Student("黑熊精", 100, "male", 12)
python = Course("python", 6, 10000)
linux = Course("linux", 6, 6000)
go = Course("go", 10, 20000)

# stu1.course = python
stu1.course=linux

# stu1.course.chiose_course()
print(stu1.__dict__)
print(stu1.course.__dict__)
